package com.tiyo.system.controller;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tiyo.framework.web.controller.BaseController;
import com.tiyo.system.mapper.domain.SysMenu;
import com.tiyo.system.service.SysMenuService;
/**
 * 
 * @Description 菜单管理
 * @author yangb
 * @version v1.0
 * @date 2021年1月21日
*
 */
@RequestMapping("/system/menu")
@Controller
public class SysMenuController extends BaseController {
	private String prefix = "system/menu";
	@Autowired
	SysMenuService sysMenuService;
	@RequiresPermissions("system:menu:view")
	@GetMapping()
	public String menu() {
		return prefix + "/menu";
	}
	@RequiresPermissions("system:menu:page")
	@PostMapping("/list")
	@ResponseBody
	public List<SysMenu> list(SysMenu menu) {
		return sysMenuService.selectMenuList(menu);
	}
	
}
